package com.cnblsp2.android.study.dbandio;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.cnblsp2.android.study.dbandio.db.DBActivity;
import com.cnblsp2.android.study.dbandio.db.DictActivity;
import com.cnblsp2.android.study.dbandio.files.FileActivity;
import com.cnblsp2.android.study.dbandio.files.SDCardFileActivity;
import com.cnblsp2.android.study.dbandio.files.SDFileListActivity;
import com.cnblsp2.android.study.dbandio.gesture.GestureActivity;
import com.cnblsp2.android.study.dbandio.sharedprefer.ReadOtherPreferencesActivity;
import com.cnblsp2.android.study.dbandio.sharedprefer.SharedPreferencesActivity;
import com.cnblsp2.android.study.dbandio.sharedprefer.UseCountActivity;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		((Button) this.findViewById(R.id.activity_main_sharedPreferences_btn)).setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(MainActivity.this, SharedPreferencesActivity.class);
				startActivity(intent);
			}
		});

		((Button) this.findViewById(R.id.activity_main_useCount_btn)).setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(MainActivity.this, UseCountActivity.class);
				startActivity(intent);
			}
		});
		((Button) this.findViewById(R.id.activity_main_readother_btn)).setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(MainActivity.this, ReadOtherPreferencesActivity.class);
				startActivity(intent);
			}
		});

		((Button) this.findViewById(R.id.activity_main_file_btn)).setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(MainActivity.this, FileActivity.class);
				startActivity(intent);
			}
		});

		((Button) this.findViewById(R.id.activity_main_sdcardFile_btn)).setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(MainActivity.this, SDCardFileActivity.class);
				startActivity(intent);
			}
		});

		((Button) this.findViewById(R.id.activity_main_sdfileList_btn)).setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(MainActivity.this, SDFileListActivity.class);
				startActivity(intent);
			}
		});

		((Button) this.findViewById(R.id.activity_main_db_btn)).setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(MainActivity.this, DBActivity.class);
				startActivity(intent);
			}
		});

		((Button) this.findViewById(R.id.activity_main_dict_btn)).setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(MainActivity.this, DictActivity.class);
				startActivity(intent);
			}
		});

		((Button) this.findViewById(R.id.activity_main_gesture_btn)).setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(MainActivity.this, GestureActivity.class);
				startActivity(intent);
			}
		});

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
